Date: Mon, 11 Nov 1996 17:13:24 GMT
Server: NCSA/1.5
Content-type: text/html
Last-modified: Fri, 06 Sep 1996 06:52:56 GMT
Content-length: 4428

<HTML>
<HEAD>
<TITLE>Program 0 - CS 302 Fall 1996 - Section 4</TITLE>
</HEAD>
<BODY>

<H1 ALIGN=CENTER>
  <!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><A HREF="http://www.cs.wisc.edu/~cs302">CS 302</A>
  Fall 1996 - <!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><A HREF="http://www.cs.wisc.edu/~milo/cs302.html">Section 4</A>
</H1> 
<H2 ALIGN=CENTER>Algebraic Language Programming in C++</H2>
<H4 ALIGN=CENTER>Instructor: 
  <!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><A HREF="http://www.cs.wisc.edu/~milo">Milo M. Martin</A> 
  (milo@cs.wisc.edu)</H4>
<hr><br>

<H1 ALIGN=CENTER>Program 0</H1>
<H3 ALIGN=CENTER>Due Wednesday, September 11, 1996</H3> 
<hr><br>

<B>Objective:</B> Program 0 is designed to give you practice editing,
compiling, executing, modifying, and documenting a program.  This program
is not graded, but is required to receive a passing grade in the class. 
<P>

Before doing this assignment you may want to some
review the help documents from the <!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><A HREF=
"http://www.cs.wisc.edu/~cs302">CS302 home page</A>, such as the
introduction to <!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><A
HREF="http://www.cs.wisc.edu/~cs302/C++/Introduction/MSwindows.html">
Microsoft Windows</A> and <!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><A HREF=
"http://www.cs.wisc.edu/~cs302/C++/Borland4.5/intro.html"> Borland C++
</A>. 

<p>

Do the following exercises:
<UL>
  <LI> Create your program directories. To do this, start the <!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><A HREF= 
"http://www.cs.wisc.edu/~cs302/C++/Introduction/filemanager1.html">File 
Manager</A>, select the <B>Copy...</B> option from the <B>File</B> menu. 
In the next window enter the following in the ``From:'' field,
"<TT>R:\PUBLIC\MILO\PROGRAMS</TT>", In the ``To:'' field, enter
"<TT>U:\</TT>". 

  <LI> Do problem 1-1, page 33 (chapter 1, problem 1):  Enter and run the
program from Display 1.8, on page 21 of the text.  When entering the
program, pay close attention to the indentation of the lines of the
program. 
  <LI> Do problem 1-2, page 33. 
  <LI> The program as presented has no comments or other documentation. 
Add header documentation (comments at the top of a source file) which
contains the program title and number, your name, section, instructor,
etc.  Any characters on a line after <TT>//</TT> is a comment, and words
between <TT>/* */</TT> are also comments.  This last kind of comment
works across multiple lines. 
  <LI> Turn in the assignment following the guidelines given in <!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><A 
HREF= "http://www.cs.wisc.edu/~milo/cs302/turnin.html">Turning in Assignments</A>. 

</UL>

<H3>Borland C++ 4.5 Hints</H3>

Start Borland C++ <B>4.5</B> which is found in the <B>CSApps</B> program
group.  Make sure you are using <B>4.5</B> instead of 4.0 -- your CSApps
program group may contain both.  When you have Borland up and running,
you want to first create a file to write your program in.  You click on
<B>File</B> in the left corner of the screen, and choose <B>New</B>
within the menu that drops down.  An empty box will appear on your
screen; this is where you will write your program.  You will want to save
your programs often.  The first time you save it, choose <B>Save as</B>
within the <B>File</B> menu.  Click on the folders in the box on the
right so that you will be saving the file in <TT>"U:\PROGRAMS\PROG0"</TT>.
For the name of the file, enter <TT>"PROG0.CPP"</TT>.  The <TT>.CPP</TT>
lets you know that it is a C++ source file.  The second time you save,
you can just choose <B>Save</B>, and it will be done automatically.  To
access a file that you have previously saved to the disk, simply choose
<B>Open</B> from the <B>File</B> menu, changing to the desired folder,
and then selecting the file. 

<P>

Once you have the program typed into the file window, and you have saved
the program in case something unsavory happens, then you just need to
press the little lightening bolt button near the top of the screen.  Your
program will be compiled, linked, and run.  If you made a typing
error, chances are you will get a syntax error.  Go back to the program,
check your typing, and when the mistake is found, change it and run the
program again. 

<P>

When the program runs, it will create a window, and prompt you for the
program input.  When the program is done the word ``interactive'' appears
in the title bar.  After the program finishes, you can close the window it
created by double clicking on the upper-left corner of the window. 

<HR>
<ADDRESS>
  <!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><A HREF="http://www.cs.wisc.edu/~milo">Milo M. Martin</a>

  (<!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><A HREF="http://www.cs.wisc.edu/cgi-bin/finger?milo">milo</a>@<!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><A
      HREF="http://www.cs.wisc.edu">cs</a>.<!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><A
      HREF="http://www.wisc.edu">wisc.edu</a>)<br>

</ADDRESS>

</BODY>
</HTML>
